unit Core;

interface

uses
  BaseTypes, Sound;

type
  TCore = class(TInterfacedObject, ICore, ISound)
  strict private
    FSound: ISound;
    class var FInstance: TCore;
    constructor Create;
  public
    class function GetInstance: ICore;
    function Initialize: TResult;
    property Sound: ISound read FSound implements ISound;
  end;

implementation

constructor TCore.Create;
begin
  inherited;
end;

class function TCore.GetInstance: ICore;
begin
  If FInstance = nil Then
  begin
    FInstance := Core.TCore.Create();
  end;
  Result := FInstance;
end;

function TCore.Initialize: TResult;
begin
  FSound := TSound.GetInstance(self);
  FSound.Initialize;
end;

end.
